package com.version.manager.controller.wx;

import com.version.manager.controller.BaseController;
import com.version.manager.entity.Shop.shopCategory;
import com.version.manager.model.Msg;
import com.version.manager.service.Shop.shopCategoryDetailService;
import com.version.manager.service.Shop.shopCategoryService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(value = "WxCategoryController")
@RequestMapping("/shop")
public class WxCategoryController extends BaseController<shopCategoryService, shopCategory> {
    @Autowired
    private shopCategoryService biz;
    @Autowired
    private shopCategoryDetailService categoryDetailService;
    @RequestMapping(value = "category",method = RequestMethod.GET)
    @ResponseBody
    public Msg getCategory(){
        List<shopCategory> list= biz.getAllList();
        return Msg.success().addData(list);
    }


    @RequestMapping(value = "getDetail",method = RequestMethod.GET)
    @ResponseBody
    public Msg getDetail(String categoryId){
        return categoryDetailService.getDetail(categoryId);
    }



}
